<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数学</title>
</head>
<body>
<h2>Math 属性（常量）</h2>
<p>JavaScript 提供了可由 Math 对象访问的 8 个数学常量：</p>

<p id="demo"></p>

<script>
  document.getElementById("demo").innerHTML =
          "<p><b>Math.E:</b> " + Math.E + "</p>" +
          "<p><b>Math.PI:</b> " + Math.PI + "</p>" +
          "<p><b>Math.SQRT2:</b> " + Math.SQRT2 + "</p>" +
          "<p><b>Math.SQRT1_2:</b> " + Math.SQRT1_2 + "</p>" +
          "<p><b>Math.LN2:</b> " + Math.LN2 + "</p>" +
          "<p><b>Math.LN10:</b> " + Math.LN10 + "</p>" +
          "<p><b>Math.LOG2E:</b> " + Math.LOG2E + "</p>" +
          "<p><b>Math.Log10E:</b> " + Math.LOG10E + "</p>";
</script>

</body>
</html>

<!--
运行结果：
Math.E: 2.718281828459045
Math.PI: 3.141592653589793
Math.SQRT2: 1.4142135623730951
Math.SQRT1_2: 0.7071067811865476
Math.LN2: 0.6931471805599453
Math.LN10: 2.302585092994046
Math.LOG2E: 1.4426950408889634
Math.Log10E: 0.4342944819032518
-->